import request from '@/config/axios'

// 标签信息 VO
export interface TagInfoVO {
  id: number // id
  name: string // 标签名称
  color: string // 标签颜色
  groupId: number // 标签组id
}

// 标签信息 API
export const TagInfoApi = {
  // 查询标签信息分页
  getTagInfoPage: async (params: any) => {
    return await request.get({ url: `/bpm/tag-info/page`, params })
  },

  // 查询指定标签组的标签信息
  getTagInfoByGroupId: async (groupId: number) => {
    return await request.get({ url: `/bpm/tag-info/select` + groupId })
  },

  // 查询标签信息详情
  getTagInfo: async (id: number) => {
    return await request.get({ url: `/bpm/tag-info/get?id=` + id })
  },

  // 新增标签信息
  createTagInfo: async (data: TagInfoVO) => {
    return await request.post({ url: `/bpm/tag-info/create`, data })
  },

  // 修改标签信息
  updateTagInfo: async (data: TagInfoVO) => {
    return await request.put({ url: `/bpm/tag-info/update`, data })
  },

  // 删除标签信息
  deleteTagInfo: async (id: number) => {
    return await request.delete({ url: `/bpm/tag-info/delete?id=` + id })
  },

  // 导出标签信息 Excel
  exportTagInfo: async (params) => {
    return await request.download({ url: `/bpm/tag-info/export-excel`, params })
  },
}
